//
//  BaseViewController.m
//  HeWeiZhiNeng
//
//  Created by chengzhang Yan on 2017/11/30.
//  Copyright © 2017年 YanCeyMichael.github.io. All rights reserved.
//

#import "BaseViewController.h"

@interface BaseViewController ()

@end

@implementation BaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self.view setBackgroundColor:white_];
    
    //界面上的按钮操作响应的唯一性
    [[UIButton appearance] setExclusiveTouch:YES];
    
    self.automaticallyAdjustsScrollViewInsets = NO;
    
    self.extendedLayoutIncludesOpaqueBars = YES;
    
    self.edgesForExtendedLayout = UIRectEdgeNone;
    
    self.definesPresentationContext = YES;
    
    //当容器是navigation controller时，默认的布局将从navigation bar的顶部开始,UI元素都往上漂移了44pt
    if ([self respondsToSelector:@selector(setEdgesForExtendedLayout:)])
    {
        [self setEdgesForExtendedLayout:UIRectEdgeNone];
    }
    
}

#pragma mark ----- 创建无网络视图 -----
-(NoNetWorkView *)networkView{
    if (!_networkView) {
        _networkView = [[NoNetWorkView alloc]initWithFrame:CGRectMake(kScreenW/2-90, kScreenH/2-50, 180, 80)];
        _networkView.backgroundColor = [UIColor blackColor];
        _networkView.layer.masksToBounds = YES;
        _networkView.layer.cornerRadius = 5;
        _networkView.alpha = 0;
    }
    return _networkView;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (UIStatusBarStyle)preferredStatusBarStyle
{
    return UIStatusBarStyleDefault;
}
    

@end
